<template>
	<view class="wanl-money">
		<view class="bg-orange padding-bj">
			<text class="title">消费券（元）</text>
			<view class="margin-top margin-bottom-xs">
				<text class="text-sl">{{reim}}</text>
			</view>
		</view>
		<!-- 功能 -->
		<view class="cu-list menu sm-border">
			<view class="cu-item arrow" @tap="$wanlshop.to('/pages/user2/reimbursement/billlist')">
				<view class="content">
					<text class="wlIcon-chongzhichenggong text-orange"></text>
					<text>消费券权益</text>
				</view>
				<view class="action">
					<text class="text-sm wanl-gray">订单产生的消费券权益</text>
				</view>
			</view>
			<view class="cu-item arrow" @tap="$wanlshop.to('/pages/user2/reimbursement/list')">
				<view class="content">
					<text class="wlIcon-yue1 text-orange"></text>
					<text>消费券日志</text>
				</view>
				<view class="action">
					<text class="text-sm wanl-gray">已申请消费券的明细</text>
				</view>
			</view>
			<view class="cu-item arrow" @tap="$wanlshop.to('/pages/user2/reimbursement/list')">
				<view class="content">
					<text class="wlIcon-jinbitixian text-orange"></text>
					<text>消费券消费</text>
				</view>
				<view class="action">
					<text class="text-sm wanl-gray">已消费券的消费明细</text>
				</view>
			</view>
			<view class="cu-item arrow" @tap="$wanlshop.to('/pages/user2/reimbursement/exchange')">
				<view class="content">
					<text class="wlIcon-jinbitixian text-orange"></text>
					<text>消费券兑换金币</text>
				</view>
				<view class="action">
					<text class="text-sm wanl-gray">消费券和金币的兑换</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import { mapState } from 'vuex';
export default {
	data() {
		return {
			reim: '0.00' // 零钱
		};
	},
	computed: {
		...mapState(['user'])
	},
	onLoad() {
		this.loadData();
	},
	methods: {
		async loadData() { 
			await uni.request({
				url: '/wanlshop/pay/getReim',
				method: 'POST',
				success: res => {
					
					this.reim = res.data;
					console.log(this.reim);
					this.$store.commit('user/setUserInfo', {reim: res.data});
				}
			});
		}
	}
};
</script>

<style>
.wanl-money .title{
	color: rgba(255, 255, 255, .7);
}
</style>
